import http
import utime as time


#用于下载OTA升级包，下载完后自动更新
def ota_py_app(url):
    global ota_flag
   
    htp = http.client()
    ota_flag = 0
    if htp.fotaPy(url) == 0:  #py固件下载成功，重启设备
        print('------------------htp.pyfotaPy')
        time.sleep_ms(1000)
        reboot()
    else:
        print('pyota failed!')